saveToString

abstract suspend fun saveToString(blocks: List<DesignBlock>, allowedResourceSchemes: List<String> = listOf("bundle", "file", "http", "https")): String

Saves the given blocks to a proprietary string. If given the root of a block hierarchy, e.g. a page with multiple children, the entire hierarchy is saved. If a resource uri of any block in that hierarchy has a scheme that is not in allowedResourceSchemes, an exception will be thrown. Note: All given block handles must be valid, otherwise an exception will be thrown.

Performs an internal update to lay out pending changes before the save.

While a font loads, its text is laid out with another font. When the text's size follows its content, blocks saved before the font arrives can differ from blocks saved after it. To compare two saves, first call engine.block.forceLoadResources(blocks).

Return

a string representation of the blocks.

Parameters

blocks

the blocks to save.

allowedResourceSchemes

the list of allowed resource schemes in the scene.